package edu.gdkm.factory;

import edu.gdkm.singleton.NumberUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

@Component
public class ToyFactory {

    @Bean(name="iso-toy")
    @Scope("prototype")
    public static Toy createToy(@Value("") String name){
        return new Toy("km-"+name, NumberUtils.getInstance().getCode());
    }
}
